import time
from concurrent.futures import ProcessPoolExecutor, as_completed


def excutor(t):
    time.sleep(t)
    print('this is %s' % t)
    return t


if __name__ == '__main__':

    ppe = ProcessPoolExecutor(max_workers=5)
    urls = [6, 2, 6, 4, 5]
    alltask = [ppe.submit(excutor, u) for u in urls]

    for i in as_completed(alltask):
        print(i.done())

    # map
    [print(i)for i in ppe.map(excutor,urls)]
